const { resolve } = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');
const AddAssetHtmlWebpackPlugin = require('add-asset-html-webpack-plugin');

module.exports = {
    entry: './src/index.js',
    output: {
        filename: 'built.js',
        path: resolve(__dirname, 'build')
    },
    plugins: [
        new HtmlWebpackPlugin({
            template: './src/index.html'
        }),
        // 告诉webpack哪些库不参与打包，同时使用时的名称也得变~
        // 注意要在html中引入dll资源
        new webpack.DllReferencePlugin({
            manifest: resolve(__dirname, './build/dll/jquery.manifest.json')
        }),
        new webpack.DllReferencePlugin({
            manifest: resolve(__dirname, './build/dll/vue.manifest.json')
        })
    ],
    mode: 'development'
};
